package com.rbc.rlslips.factory;

import java.net.URL;

import javax.xml.namespace.QName;

import com.rbc.rlslips.ServiceManager.ServiceManager;
import com.rbc.rlslips.enums.ServicesEnum;
import com.rbc.rlsplips.servicemanager.impl.AnnuaireLogicielServiceImpl;

public class ServiceManagerFactory {
	
	public static ServiceManagerFactory serviceManagerFactory;
	
	public static ServiceManagerFactory newInstance(){
		if(serviceManagerFactory == null){
			serviceManagerFactory = new ServiceManagerFactory();
		}
		return serviceManagerFactory;
	}
	
	public ServiceManager createServiceManagerInstance(ServicesEnum servicesEnum,QName qName,URL url){
		ServiceManager serviceManager = null;
		switch (servicesEnum){
			case ANNUAIRE_LOGICIEL_SERVICE:
				serviceManager = new AnnuaireLogicielServiceImpl(url,qName);
				System.out.println();
				break;
			case OBTENTION_CLE_TRANS_FICHIER_SERVICE:
				//TODO add the serviceManager implementer
				break;
			case TRANS_FICHIER_RELEVE_SERVICE:
				//TODO add the serviceManager implementer
				break;
			default:
				break;
		}
		return serviceManager;
	}

}
